#include "car_supply.hpp"
#include "csv_struct.hpp"
#include "file_list.hpp"


car_supply_struct_csv const car_supply_csv::find(int _id)
{
	car_supply_struct_csv car_supply_struct_csv_null; 
	if(!_id) return car_supply_struct_csv_null;

	csv_struct csv_file(file_list::car_supply_filename());
		
	while(!csv_file.eof())
	{
		++csv_file;
		car_supply_struct_csv row(csv_file.get_line());
			
		if(row.id() != _id) continue;
			
		return row;
	}
	
	return car_supply_struct_csv_null;
	
}
